package com.nine.pattern.factory.factory_method;


/**
 * @author nine
 * @version 1.0
 * @description 咖啡店，提供咖啡
 * @date 2024-06-27 22:16
 */
public class CoffeeStore {

	private CoffeeFactory factory;

	public void setFactory(CoffeeFactory factory) {
		this.factory = factory;
	}

	public Coffee orderCoffee() {
		Coffee coffee = factory.createCoffee();
		coffee.addMilk();
		coffee.addSugar();
		return coffee;
	}

}
